import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { HttpService} from '../../providers/http-service';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  public city:string;
  public province:string;
  public temperature:string;
  public weather:string;

  constructor(
    public navCtrl: NavController,
    public service:HttpService
  ) {
   
  
  } 
  check(){
    let paramObj={
      city:'西安'
    };
    this.service.getWeather(paramObj).then(
      data=>{
        console.log(data);
        this.weather=data.result[0].weather;
        this.city=data.result[0].city;
        this.province=data.result[0].province;
        this.temperature=data.result[0].temperature;
      }
    )
  }
}
